import { createStore } from 'vuex'
import persist from 'vuex-persistedstate'
export default createStore({
  state: {
    list: []
  },
  getters: {
  },
  mutations: {
    add(state, obj) {
      var i = state.list.findIndex(item => item.id == obj.id)
      if (i != -1) {
        state.list[i].paixu++
      } else {
        state.list.push(obj)
      }
    },
    kong(state) {

    },
  },
  actions: {
  },
  modules: {
  },
  plugins: [
    new persist({
      storage: window.localStorage
    })
  ]
})
